class SarsaLearner : public GameAgent
{
public:
    SarsaLearner(Game *game, const SARSA_TRANSFORM_TYPE transform, const vector<ControllerState> &actions);
    ~SarsaLearner() { delete _traceVector; }
    virtual void takeStep();
    virtual double getTotalComputeTime();

private:
    int pickAction(double epsilon);
    double getValue(const Frame &frame, int actionIndex);
    // double getValue(const Frame &frame, const ControllerState &action);
    double getReward(const Frame &frame);
    void updateLearningParameters();
    // Specific to gridworld; remove later
    // void printCurrentPolicy();

    SARSA_TRANSFORM_TYPE _transform;
    vector<ControllerState> _actions;
    UINT _featureDim;

    vector<double> _weightVector;
    AbstractDoubleVector *_traceVector;

    int _nextAction;

    vector<double> _computeTimes;
};